package com.yjt.fresh.adpater;

import android.support.annotation.Nullable;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yjt.fresh.R;
import com.yjt.fresh.bean.BeanComment;
import com.yjt.fresh.bean.BeanHomePage;
import com.yjt.fresh.bean.BeanProductDetail;
import com.yjt.fresh.widget.GlideCircleTransform;
import com.yjt.fresh.widget.RatingBar;

import java.util.List;

/**
 * 评论
 * Created by mcc on 2018/6/10.
 */

public class AdpRvAtyProductDetailComment extends BaseQuickAdapter<BeanProductDetail.EVALUATELISTBean, BaseViewHolder> {
    public AdpRvAtyProductDetailComment(int layoutResId, @Nullable List<BeanProductDetail.EVALUATELISTBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, BeanProductDetail.EVALUATELISTBean item) {
        ImageView ivLogo = helper.getView(R.id.ivAppRecycleItemCommentUserLogo);
        TextView tvUserName = helper.getView(R.id.tvAppRecycleItemCommentUserName);
        TextView tvContent = helper.getView(R.id.tvAppRecycleItemCommentContent);
        RatingBar rb = helper.getView(R.id.rbAppRecycleItemComment);

        Glide.with(mContext).load(item.getLOGO_IMG()).into(ivLogo);
        tvUserName.setText(item.getUSER_NAME());
        tvContent.setText(item.getEVALUATE_CONTENT());
        rb.setStar(Integer.valueOf(item.getEVALUATE_GRADE()));
    }
}
